package edu.faytechcc.csc.gui.search.details;

import edu.faytechcc.csc.gui.search.SearchFrame;
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * Creates and displays the DeatilsFrame
 *
 * @author Stephanie Mckenzie and Jasmin Pastari
 */
public class DetailsFrame extends JFrame
{

    /**
     * Constructor for the DetailsFrame that accepts a String and a SearchFrame.
     *
     * @param name
     * @param search
     */
    public DetailsFrame(String name, SearchFrame search)
    {
        //set the Window title
        this.setTitle(name + " : : Details");

        //Close the Window when X is clicked
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

        JPanel space = new JPanel();
        space.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));

        DetailsPanel detailPanel = new DetailsPanel(search);
        space.add(detailPanel);
        this.add(space);

        //Display the window.
        this.pack();
        this.setVisible(true);
    }
}
